﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManageFiles.aspx.cs" Inherits="WebRSSBuilder.ASP.ManageFiles" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
 <link type="text/css" href="Styles/DetailsView.css" rel="stylesheet" />  
  <style type="text/css">
.modalBackground 
        {
	        background-color:Gray;
	        filter:alpha(opacity=70);
	        opacity:0.7;
	        
        }
        .detailfooter
{
	text-align:right;
	padding:8px;
}
 .ButtonSave
        {
            background-color:#BFCBD6; 
            color:#465C71; 
            width:100px; 
            height:25px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  
       <asp:ToolkitScriptManager runat="server" ID="ScriptManager1"></asp:ToolkitScriptManager>
   <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">    
      <ContentTemplate>
        <table style="width: 100%;">
    <tr>
        <td align="center">
  
            <asp:Label ID="Label2" runat="server" CssClass="Labeltitle" 
                Text="RSS Files Manager"></asp:Label>
            <br />
              <br />

            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                DataKeyNames="FileID" DataSourceID="LinqDataSource1" ForeColor="#333333" 
                GridLines="None" style="margin-left: 0px" Width="436px">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                    <asp:TemplateField HeaderText="FileName" SortExpression="FileName">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FileName") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ControlToValidate="TextBox1" ErrorMessage="This Field is Required" 
                                ForeColor="#CC3300"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("FileName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="FileURL" SortExpression="FileURL">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FileURL") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                ControlToValidate="TextBox2" ErrorMessage="This Field is Required" 
                                ForeColor="#CC3300"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("FileURL") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Role" SortExpression="aspnet_Role.RoleName">
                        <EditItemTemplate>
                            <asp:DropDownList ID="DropDownList1" runat="server" 
                                DataSourceID="LinqDataSource2" DataTextField="RoleName" DataValueField="RoleId" 
                                Height="22px" SelectedValue='<%# Bind("RoleID") %>' Width="162px">
                            </asp:DropDownList>
                            <br />
                            <br />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" 
                                Text='<%# Eval("aspnet_Role.RoleName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="Transparent" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
            <br />
        </td>
        <td>
            &nbsp;</td>
    </tr>
            <tr>
                <td align="center">
                    <br />
                    <asp:Button ID="Button2" runat="server" CausesValidation="true" 
                        CssClass="ButtonSave" onclick="Button1_Click" Text="Insert a new Record" 
                        Width="175px" />
                 <asp:ModalPopupExtender ID="Button2_ModalPopupExtender" runat="server" 
                        BackgroundCssClass="modalBackground" CancelControlID="btnClose" 
                        PopupControlID="PopupPanel" TargetControlID="Button2"> 
                        </asp:ModalPopupExtender>             
              <asp:Panel ID="PopupPanel" runat="server" CssClass="detail" Visible="false">
                        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                            CssClass="detailgrid" DataSourceID="LinqDataSource1" DefaultMode="Insert" 
                            Visible="False" Width="435px">
                            <Fields>
                                <asp:TemplateField HeaderText="FileName" SortExpression="FileName">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FileName") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <InsertItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FileName") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                            ControlToValidate="TextBox1" ErrorMessage="This Field is Required" 
                                        ForeColor="#CC3300"></asp:RequiredFieldValidator>
                                    </InsertItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FileName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="FileURL" SortExpression="FileURL">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FileURL") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <InsertItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FileURL") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                            ControlToValidate="TextBox2" ErrorMessage="This Field is Required" 
                                        ForeColor="#CC3300"></asp:RequiredFieldValidator>
                                    </InsertItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("FileURL") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Role" SortExpression="aspnet_Role.RoleName">
                                    <InsertItemTemplate>
                                        &nbsp;
                                        <asp:DropDownList ID="DropDownList2" runat="server" 
                                            DataSourceID="LinqDataSource2" DataTextField="RoleName" DataValueField="RoleId" 
                                            Height="22px" SelectedValue='<%# Bind("RoleID") %>' Width="129px">
                                        </asp:DropDownList>
                                    </InsertItemTemplate>
                                </asp:TemplateField>
                            </Fields>
                        </asp:DetailsView>
                        <div class="detailfooter">
                            <asp:LinkButton ID="btnSave" runat="server" CausesValidation="true" 
                                OnClick="BtnSave_Click" Text="Save" />
                            <asp:LinkButton ID="btnClose" runat="server" CausesValidation="false" 
                                Text="Close" />
                        </div>
                    </asp:Panel>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
</table>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
          ContextTypeName="WebRSSBuilder.ASP.SourceDataContext" EnableDelete="True" 
          EnableInsert="True" EnableUpdate="True" EntityTypeName="" TableName="Files">
      </asp:LinqDataSource>
      <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
          ContextTypeName="WebRSSBuilder.ASP.SourceDataContext" EntityTypeName="" 
          Select="new (RoleId, RoleName)" TableName="aspnet_Roles">
      </asp:LinqDataSource>
    </p>
    <p>
    </p>
</ContentTemplate>  
 </asp:UpdatePanel>
 
</asp:Content>

